home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / x / xview / xview3.004 / xview3 / usr / openwin / include / xview_private / dndimpl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-29  |  2.6 KB  |  116 lines

  1. #ifndef lint
  2. #ifdef sccs
  3. static char     sccsid[] = "@(#)dndimpl.h 1.15 93/06/28";
  4. #endif
  5. #endif
  6.  
  7. /*
  8.  *      (c) Copyright 1990 Sun Microsystems, Inc. Sun design patents 
  9.  *      pending in the U.S. and foreign countries. See LEGAL NOTICE 
  10.  *      file for terms of the license.
  11.  */
  12.  
  13. #ifndef xview_dndimpl_DEFINED
  14. #define xview_dndimpl_DEFINED
  15.  
  16. #include <sys/time.h>
  17. #include <X11/Xlib.h>
  18. #include <xview/pkg.h>
  19. #include <xview/attr.h>
  20. #include <xview/window.h>
  21. #include <xview/dragdrop.h>
  22.  
  23. #define DND_PRIVATE(dnd_public) XV_PRIVATE(Dnd_info, Xv_dnd_struct, dnd_public)
  24. #define DND_PUBLIC(dnd)         XV_PUBLIC(dnd)
  25.  
  26. #define DND_POINT_IN_RECT(r, xx, yy) \
  27.             ((xx) >= (r)->x && (yy) >= (r)->y && \
  28.               (xx) < (r)->x+(r)->w && (yy) < (r)->y+(r)->h)
  29.  
  30. #define DND_IS_TRANSIENT(event) (event->ie_xevent->xclient.data.l[4] & \
  31.                  DND_TRANSIENT_FLAG)
  32.  
  33. #define DND_NO_SITE    -1
  34.  
  35. #define SUN_DND_TRANSIENT_TEMPLATE    "_SUN_DRAGDROP_TRANSIENT_%d_%d"
  36.  
  37.         /* Index into atom array */
  38. #define TRIGGER            0
  39. #define PREVIEW            1
  40. #define ACK            2
  41. #define DONE            3
  42. #define WMSTATE            4
  43. #define INTEREST        5
  44. #define DSDM            6
  45. #define NUM_ATOMS        DSDM +1
  46.  
  47. typedef enum {
  48.     Dnd_Trigger_Remote,
  49.     Dnd_Trigger_Local,
  50.     Dnd_Preview,
  51. } DndMsgType;
  52.  
  53. typedef struct dndrect {
  54.     int        x, y;
  55.     unsigned    w, h;
  56. } DndRect;
  57.  
  58. typedef struct dnd_site_desc {
  59.     Window     window;
  60.     long     site_id;
  61.     unsigned int nrects;
  62.     DndRect    *rect;
  63.     unsigned long flags;
  64. } Dnd_site_desc;
  65.  
  66. typedef struct dndWaitEvent {
  67.     Window     window;
  68.     int     eventType;
  69.     Atom    target;
  70. } DnDWaitEvent;
  71.  
  72. typedef struct dnd_site_rects {
  73.     long    screen_number;
  74.     long    site_id;
  75.     long    window;
  76.     long    x, y;
  77.     long    w, h;
  78.     long    flags;
  79. } DndSiteRects;
  80.  
  81. typedef struct dnd_info {
  82.     Dnd             public_self;
  83.     Xv_window         parent;
  84.     DndDragType         type;
  85.     Atom         atom[NUM_ATOMS];
  86.     Xv_opaque         cursor;
  87.     Cursor         xCursor;
  88.     Xv_opaque         affCursor;
  89.     Cursor         affXCursor;
  90.     short         transientSel;
  91.     int             drop_target_x;
  92.     int             drop_target_y;
  93.     Dnd_site_desc        dropSite;
  94.     struct timeval     timeout;
  95.     Xv_opaque         window;
  96.     Selection_requestor     sel;
  97.     DndSiteRects    *siteRects;
  98.     int             lastSiteIndex;
  99.     int             eventSiteIndex;
  100.     unsigned int     numSites;
  101.     /* DND_HACK begin */
  102.     short         is_old;
  103.     /* DND_HACK end */
  104.     int             incr_size;
  105.     int             incr_mode;      /* Response from dsdm in INCR. */
  106.     Window               lastRootWindow;
  107.     int                  screenNumber;
  108. } Dnd_info; 
  109.  
  110. Pkg_private int        dnd_init();
  111. Pkg_private Xv_opaque    dnd_set_avlist();
  112. Pkg_private Xv_opaque    dnd_get_attr();
  113. Pkg_private int        dnd_destroy();
  114.  
  115. #endif ~xview_dndimpl_DEFINED
  116.